<?php
class Thongbao extends Database
{
	public function __construct()
	{
		$this->connect();
	}
	public function show_thongbao()
	{
		$sql="select * from thongtinlienhe";
		$this->query($sql);
		while($row=$this->fetch())
		{
			$dt[]=$row;
		}
		return $dt;
	}
	public function xoa_thongbao($id)
	{
		$sql="delete from thongtinlienhe where id='".$id."'";
		$this->query($sql);
	}
	public function xem_thongbao($id)
	{
		$sql="select * from thongtinlienhe where id='".$id."'";
		$this->query($sql);
		while($row=$this->fetch())
		{
			$dt[]=$row;
		}
		return $dt;
	}
	public function capnhat_trangthai($id)
	{
		$sql="update thongtinlienhe set trangthai=1 where id='".$id."'";
		$this->query($sql);
	}
	
}